package com.woniu.ucenterservice.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@Table(name = "User")
@Data
public class TxUser implements Serializable {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer userId;
    @Length(max = 8,min = 1,message = "用户名长度1-8")
    private String username;
    @JsonIgnore
    @Length(max = 8,min = 1,message = "密码长度1-8")
    private String password;

    private String loginname;

    private String nickName;
    @Pattern(regexp = "^1[35678]\\d{9}$",message = "手机号格式不正确")
    private String phone;
    @JsonIgnore
    private String salt;

    private Date created;

    private Integer integral;
    private Integer openId;



}